$(document).ready(function(){
	
	QUnit.log = function(result, message)  
    {  
      if (window.console && window.console.log)  
      {  
        window.console.log(result +' :: '+ message);  
      }  
    }
	
	module("Document Ready");

	test("first test within module", function() {
	  ok( true, "all pass" );
	});
	
	var chat_token = $('#channel_api_params').attr('chat_token');
	
	test("chat_token", function() {
	  ok( true, chat_token );
	});
	
	var channel = new goog.appengine.Channel(chat_token);
	
	test("channel", function() {
	  ok( true, channel );
	});
	
	var socket = channel.open();
	
	test("socket", function() {
	  ok( true, socket );
	});
	
	socket.onopen = function(){
	};
	socket.onmessage = function(m){
		//alert('The other user has joined')

		$('.more').show();
	};
    socket.onerror =  function(err){
		alert("Error => "+err.description);
	};
    socket.onclose =  function(){
		alert("channel closed");
	};
	
	
	$('#center').animate({scrollTop: $("#center").attr("scrollHeight")}, 500);
});

